﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class menu123 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataSet DS = new DataSet();
            DS.ReadXml(Server.MapPath("~/Menu/Menu.xml"));
            ParentRepeater.DataSource = DS;
            ParentRepeater.DataBind();
        }
    }

    protected void ParentRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        
        RepeaterItem item = e.Item;
        if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
        {
            Repeater ChildRepeater = (Repeater)item.FindControl("ChildRepeater");
            DataRowView drv = (DataRowView)item.DataItem;
            ChildRepeater.DataSource = drv.CreateChildView("Menu_SubMenu");// here u can also bind the Child Repeater with DataTable like 
            //ChildRepeater.DataSource = datatableName;
            ChildRepeater.DataBind();       
            
           
              
        }
    }

    
}
